package com.ssy.lingxi.marketing.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.marketing.api.model.request.*;
import com.ssy.lingxi.marketing.api.model.response.CartActivityPriceFeignResponse;
import com.ssy.lingxi.marketing.api.model.response.GoodsCartResponse;
import com.ssy.lingxi.marketing.api.model.response.ProductTagResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * 活动商品feign接口
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/2
 */
@FeignClient(name = "marketing-service")
public interface ActivityGoodsControllerFeign {

    /**
     * 内部接口 - 查询活动商品活动标签
     **/
    @PostMapping(value = "/marketing/activity/feign/goods/product/tag")
    Wrapper<List<ProductTagResp>> listActivityGoodsProductTag(@Valid @RequestBody ProductTagReq req);

    /**
     * 内部接口 - 进货单获取sku商品活动
     **/
    @PostMapping(value = "/marketing/activity/feign/goods/cart/activity")
    Wrapper<List<GoodsCartResponse>> listActivityGoodsCart(@Valid @RequestBody GoodsCartRequest request);

    /**
     * 获取商品的最大优惠价格
     **/
    @PostMapping(value = "/marketing/activity/feign/goods/getPreferentialPrice")
    Wrapper<List<ProductTagResp>> getPreferentialPrice(@RequestBody ProductTagReq req);

    /**
     * 更新营销活动商品销量[新增订单，取消订单，售后退货]
     **/
    @PostMapping(value = "/marketing/feign/activity/goods/sales/update")
    Wrapper<?> updateGoodsSales(@Valid @RequestBody GoodsSalesReq req);

    /**
     * 内部接口 - 计算活动到手价[含赠品，套餐，参与的活动列表]
     */
    @PostMapping(value = "/marketing/feign/activity/goods/price/calculate")
    Wrapper<List<CartActivityPriceFeignResponse>> getPreferentialPrice(@Valid @RequestBody CartActivityPriceFeignRequest request);

    /**
     * 添加拼团
     **/
    @PostMapping(value = "/marketing/feign/add/group/purchase")
    Wrapper<Long> addGroupPurchase(@Valid @RequestBody GroupPurchaseAddRequest req);
    /**
     * 判断是否重复参与同一个拼团
     * @Return true=已重复参与，false=未参与
     **/
    @PostMapping(value = "/marketing/feign/is/repeat/join/group/purchase")
    Wrapper<Boolean> isRepeatJoinGroupPurchase(@Valid @RequestBody GroupPurchaseCheckRequest req);

}
